import { axios } from '@/service/service'
import { ListReq } from './types'

export function getSQLManageList(data: ListReq): any {
  return axios({
    url: '/report/querySql',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    transformRequest: (params) => JSON.stringify(params)
  })
}

export function editSQLManage(data: any): any {
  return axios({
    url: '/report/updateSql',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    transformRequest: (params) => JSON.stringify(params)
  })
}

export function exportSQLManage(): any {
  return axios({
    url: '',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    transformRequest: (params) => JSON.stringify(params)
  })
}

export function deleteSQLManage(data: any): any {
  return axios({
    url: '/report/deleteSql',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    transformRequest: (params) => JSON.stringify(params)
  })
}
